<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        <li v-bind:key='index' v-for="(item,index) in fruits">
            {{item}}----{{index}}
        </li>


        <hr>
        <ul>
            <!-- vue的v-for强大之处  当遍历数组的时候切换数组形态 遍历对象 切换对象形态适配 -->
            <li v-for="(value,key,index,e) in user" :key='index'>
                  <p>
                      {{value}} --- {{key}} --- {{index}}---{{e}}
                  </p>
            </li>
        </ul>
        
    </div>


    <script>
   
        var app = new Vue({
            el: '#app',
            data: {
                message: 'Hello Vue22222!',
                fruits:['香蕉','苹果','橘子'],
                user:{
                    name:'张无忌',
                    gender:'男',
                    age:25,
                    email:150
                }
            }
        })

        console.log('app', app)

    </script>
</body>

</html>